package com.neuedu.javase;

/**
 * @auth 金山老师
 * title:   书籍代码
 * creatime: 2022-09-23 11:10
 * 描述 : 数组的排序
 */
public class MyArraySort {

    public static void main(String[] args) {

        int nums[] = new int[]{    9,30,1,2,15,18,44 };

        int temp;
        for (int j = 0; j < nums.length; j++) {
            for (int i = j+1; i < nums.length; i++) {
                if(nums[j] >nums[i] ){
                    temp = nums[i];
                    nums[i] = nums[j];
                    nums[j] = temp;
                }
            }
        }


        for (int i = 0; i < nums.length; i++) {
            System.out.println("nums["+i+"] = " + nums[i]);
        }


    }




}
